/* FilmTrack 主样式文件 */
@import 'tailwindcss/base';
@import 'tailwindcss/components';
@import 'tailwindcss/utilities';

/* 导入字体样式 */
@import '../assets/styles/fonts.css';

/* 自定义CSS变量 */
:root {
  /* 色彩变量 */
  --color-primary: #3b82f6;
  --color-primary-dark: #1d4ed8;
  --color-secondary: #a855f7;
  --color-success: #22c55e;
  --color-warning: #f59e0b;
  --color-error: #ef4444;
  
  /* 背景色 */
  --color-bg-primary: #ffffff;
  --color-bg-secondary: #f9fafb;
  --color-bg-tertiary: #f3f4f6;
  
  /* 文字色 */
  --color-text-primary: #111827;
  --color-text-secondary: #6b7280;
  --color-text-tertiary: #9ca3af;
  
  /* 边框色 */
  --color-border: #e5e7eb;
  --color-border-hover: #d1d5db;
  
  /* 阴影 */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  
  /* 动画时长 */
  --duration-fast: 0.15s;
  --duration-normal: 0.3s;
  --duration-slow: 0.5s;
  
  /* 边界半径 */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
}

/* 暗色主题变量 */
[data-theme="dark"] {
  --color-bg-primary: #111827;
  --color-bg-secondary: #1f2937;
  --color-bg-tertiary: #374151;
  
  --color-text-primary: #f9fafb;
  --color-text-secondary: #d1d5db;
  --color-text-tertiary: #9ca3af;
  
  --color-border: #374151;
  --color-border-hover: #4b5563;
}

/* 全局样式 */
* {
  /* 禁用文本选择 */
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  
  /* 禁用拖拽 */
  -webkit-user-drag: none;
  -khtml-user-drag: none;
  -moz-user-drag: none;
  -o-user-drag: none;
  user-drag: none;
  
  /* 禁用右键菜单 */
  -webkit-context-menu: none;
}

/* 允许输入框和文本区域选择文本 */
input, textarea, [contenteditable="true"] {
  -webkit-user-select: auto;
  -moz-user-select: auto;
  -ms-user-select: auto;
  user-select: auto;
  }
  
/* 禁用右键菜单 */
  body {
  -webkit-context-menu: none;
  font-family: 'PingFang SC', 'Microsoft YaHei', -apple-system, sans-serif;
  font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  }
  
/* 开发环境允许开发者工具 */
@media (prefers-color-scheme: dark) {
  :root {
    --color-gray-50: rgb(28, 28, 30);
    --color-gray-100: rgb(44, 44, 46);
    --color-gray-200: rgb(58, 58, 60);
    --color-gray-300: rgb(72, 72, 74);
    --color-gray-400: rgb(99, 99, 102);
    --color-gray-500: rgb(142, 142, 147);
    --color-gray-600: rgb(174, 174, 178);
    --color-gray-700: rgb(199, 199, 204);
    --color-gray-800: rgb(209, 209, 214);
    --color-gray-900: rgb(242, 242, 247);
  }
  }
  
/* 自定义滚动条 - 更优雅的设计 */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.2), rgba(59, 130, 246, 0.3));
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.4), rgba(59, 130, 246, 0.5));
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
}

::-webkit-scrollbar-corner {
  background: transparent;
}

/* 火狐浏览器滚动条样式 */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(59, 130, 246, 0.2) rgba(0, 0, 0, 0.02);
}

/* 毛玻璃效果 */
.backdrop-blur-apple {
  backdrop-filter: var(--backdrop-blur);
  -webkit-backdrop-filter: var(--backdrop-blur);
}

/* Apple Design 按钮 */
.btn-apple {
  @apply px-4 py-2 rounded-lg font-medium transition-all duration-200;
  @apply bg-blue-500 text-white hover:bg-blue-600 active:scale-95;
  @apply focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2;
  }
  
.btn-apple-secondary {
  @apply px-4 py-2 rounded-lg font-medium transition-all duration-200;
  @apply bg-gray-100 text-gray-700 hover:bg-gray-200 active:scale-95;
  @apply focus:outline-none focus:ring-2 focus:ring-gray-500 focus:ring-offset-2;
  }
  
/* Apple Design 输入框 */
.input-apple {
  @apply w-full px-3 py-2 border border-gray-300 rounded-lg;
  @apply focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500;
  @apply transition-all duration-200;
  }
  
/* Apple Design 选择框 */
.select-apple {
  @apply w-full px-3 py-2 border border-gray-300 rounded-lg bg-white;
  @apply focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500;
  @apply transition-all duration-200 appearance-none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%236B7280'%3E%3Cpath fill-rule='evenodd' d='M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z' clip-rule='evenodd'/%3E%3C/svg%3E");
  background-position: right 0.5rem center;
  background-repeat: no-repeat;
  background-size: 1.5em 1.5em;
  padding-right: 2.5rem;
  }
  
  /* 卡片样式 */
.card-apple {
  @apply bg-white rounded-xl shadow-sm border border-gray-200;
  @apply transition-all duration-200 hover:shadow-md;
  }
  
  /* 渐变背景 */
.gradient-apple {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  }
  
/* 动画效果 */
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-20px); }
}

.animate-float {
  animation: float 6s ease-in-out infinite;
}

/* 自定义加载动画 */
@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.animate-spin-slow {
  animation: spin-slow 3s linear infinite;
  }
  
/* 文本渐变效果 */
.text-gradient {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  }
  
/* 毛玻璃卡片 */
.glass-card {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  }
  
/* 悬停效果 */
.hover-lift {
  transition: transform 0.2s ease-out, box-shadow 0.2s ease-out;
  }
  
.hover-lift:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  }
  
  /* 窗口拖拽区域 */
  .window-drag {
    -webkit-app-region: drag;
  }
  
  .window-no-drag {
    -webkit-app-region: no-drag;
}

/* 液态按钮效果 */
.liquid-button {
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.23, 1, 0.320, 1);
}

.liquid-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.liquid-button:hover::before {
  left: 100%;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .btn-apple, .btn-apple-secondary {
    @apply px-3 py-2 text-sm;
  }
  
  .input-apple, .select-apple {
    @apply px-2 py-1.5 text-sm;
  }
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
  .btn-apple {
    @apply border-2 border-blue-700;
  }
  
  .input-apple, .select-apple {
    @apply border-2 border-gray-500;
  }
}

/* 减少动画模式 */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* 响应式设计断点 */
@media (max-width: 640px) {
  .card {
    @apply rounded-lg;
  }
  
  .modal-content {
    @apply rounded-xl;
  }
}

/* 打印样式 */
@media print {
  .no-print {
    display: none !important;
  }
  
  .card {
    @apply shadow-none border;
  }
}

/* 动画优化 */
@media (prefers-reduced-motion: reduce) {
  *,
  ::before,
  ::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* 高对比度模式 */
@media (prefers-contrast: high) {
  .card {
    @apply border-2 border-gray-900;
  }
  
  .btn {
    @apply border-2;
  }
}

/* 星级评分组件 - 5星制 */
.star-button {
  @apply p-1 rounded-full transition-all duration-200 hover:scale-110 hover:bg-yellow-50;
}

.star-button.active {
  @apply scale-110;
}

.star-button:hover {
  animation: starPulse 0.3s ease-in-out;
}

@keyframes starPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1.15); }
}

.star-rating-5 .star-button {
  @apply p-2;
}

.star-rating-5 .star-button svg {
  width: 24px;
  height: 24px;
}

/* 液态侧边栏动画 */
.nav-item {
  @apply relative transition-all duration-300 ease-out;
}

.nav-liquid-bg {
  @apply absolute inset-0 rounded-xl transition-all duration-500 ease-out;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  transform: scale(0.8);
  opacity: 0;
}

.nav-item.active .nav-liquid-bg {
  transform: scale(1);
  opacity: 1;
  animation: liquidExpand 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.nav-item:hover .nav-liquid-bg {
  transform: scale(0.95);
  opacity: 0.3;
}

@keyframes liquidExpand {
  0% {
    transform: scale(0.8) rotate(-5deg);
    opacity: 0;
    border-radius: 20px;
  }
  50% {
    transform: scale(1.1) rotate(2deg);
    opacity: 0.8;
    border-radius: 15px;
  }
  100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
    border-radius: 12px;
  }
}

.nav-item-content {
  @apply relative z-10 transition-all duration-300;
}

.nav-item.active .nav-item-content {
  @apply text-white;
}

.nav-item:hover .nav-item-content {
  @apply text-gray-700;
}

/* Apple Design 组件样式优化 */
.select-apple {
  @apply appearance-none bg-white/80 backdrop-blur-sm border border-gray-200 rounded-xl px-4 py-3 
         text-gray-900 focus:outline-none focus:ring-2 focus:ring-blue-500/20 focus:border-blue-500 
         transition-all duration-200 hover:bg-white/90 hover:border-gray-300;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 12px center;
  background-repeat: no-repeat;
  background-size: 16px;
  padding-right: 40px;
}

.input-apple {
  @apply bg-white/80 backdrop-blur-sm border border-gray-200 rounded-xl px-4 py-3 
         text-gray-900 placeholder-gray-500 focus:outline-none focus:ring-2 focus:ring-blue-500/20 
         focus:border-blue-500 transition-all duration-200 hover:bg-white/90 hover:border-gray-300
         focus:placeholder-gray-400;
}

.date-picker-apple {
  @apply bg-white/80 backdrop-blur-sm border border-gray-200 rounded-xl px-4 py-3 
         text-gray-900 focus:outline-none focus:ring-2 focus:ring-blue-500/20 focus:border-blue-500 
         transition-all duration-200 hover:bg-white/90 hover:border-gray-300;
}

.date-picker-apple::-webkit-calendar-picker-indicator {
  @apply cursor-pointer opacity-60 hover:opacity-100 transition-opacity duration-200;
} 